package com.info.zhiduoduo.common.excelconverter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * @program: zhiduoduo
 * @author: LiTong
 * @create: 2021-01-18 14:32
 **/
public class PaymentStatusConverter implements Converter<Integer> {

    @Override
    public Class supportJavaTypeKey() {
        return null;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return null;
    }

    @Override
    public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return null;
    }

    @Override
    public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        if (value == 0) {
            return new CellData("已创建");
        } else if (value == 1) {
            return new CellData("交易中");
        } else if (value == 2) {
            return new CellData("交易成功");
        } else if (value == 3) {
            return new CellData("交易失败");
        } else if (value == 4) {
            return new CellData("拒绝");
        } else {
            return new CellData("");
        }
    }
}
